﻿using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using Cinch;
using SLS.ExClassLib.Loc;
namespace SLS.ExClassLib.ViewModel
{  
    /// <summary>
    /// Defines a base class for view.
    /// </summary>
    public class ViewData : ContentControl, IWorkSpaceAware, INotifyPropertyChanged
    {
        #region==============T=====================================
        #endregion
        #region==================IWorkSpaceAware =================
        /// <summary>
        /// WorkSpaceContextualData Dependency Property
        /// </summary>
        public static readonly DependencyProperty WorkSpaceContextualDataProperty =
            DependencyProperty.Register("WorkSpaceContextualData", typeof(object), typeof(ViewData),
                new FrameworkPropertyMetadata((WorkspaceData)null));

        /// <summary>
        /// Gets or sets the WorkSpaceContextualData property.  
        /// </summary>
        public WorkspaceData WorkSpaceContextualData
        {
            get { return (WorkspaceData)GetValue(WorkSpaceContextualDataProperty); }
            set { SetValue(WorkSpaceContextualDataProperty, value); }
        } 
        public static readonly DependencyProperty LocalizationModelProperty =
    DependencyProperty.Register("LocalizationModel", typeof(ILocalizationModel), typeof(ViewData),
        new FrameworkPropertyMetadata((ILocalizationModel)null));

        /// <summary>
        /// Gets or sets the WorkSpaceContextualData property.  
        /// </summary>
        public virtual ILocalizationModel LocalizationModel
        {
            get { return (ILocalizationModel)GetValue(LocalizationModelProperty); }
            set { SetValue(LocalizationModelProperty, value); }
        } 
        #endregion

        #region==============Data==================================
        #endregion
        #region==============Ctor==================================
        public ViewData()
        {

        } 
        #endregion
        #region==============Events================================
        #endregion
        #region==============Property==============================
        /// <summary>
        ///   The property changed.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// Publishes the PropertyChanged event.
        /// </summary>
        /// <param name="propertyName"></param>
        protected internal void OnPropertyChange(String propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
      
        #endregion
    }
}
